package poi;

import java.util.Objects;

/**
 * 乘车安排
 * @author likai
 */
public class Accommodation {

    /**
     * 姓名
     */
    String userName;
    /**
     * 职位
     */
    String position;
    /**
     * 房间号
     */
    String roomNo;
    /**
     * 车次号
     */
    String carNo;

    public Accommodation() {
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getRoomNo() {
        return roomNo;
    }

    public void setRoomNo(String roomNo) {
        this.roomNo = roomNo;
    }

    public String getCarNo() {
        return carNo;
    }

    public void setCarNo(String carNo) {
        this.carNo = carNo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Accommodation that = (Accommodation) o;

        if (!Objects.equals(userName, that.userName)) {
            return false;
        }
        if (!Objects.equals(position, that.position)) {
            return false;
        }
        return Objects.equals(roomNo, that.roomNo);
    }

    @Override
    public int hashCode() {
        int result = userName != null ? userName.hashCode() : 0;
        result = 31 * result + (position != null ? position.hashCode() : 0);
        result = 31 * result + (roomNo != null ? roomNo.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Accommodation{" +
                "userName='" + userName + '\'' +
                ", position='" + position + '\'' +
                ", roomNo='" + roomNo + '\'' +
                ", carNo='" + carNo + '\'' +
                '}';
    }

}
